import 'package:json_annotation/json_annotation.dart';

part 'staff.g.dart';

@JsonSerializable(explicitToJson: true)
class Staff {
  static const int GENDER_MAN = 1;
  static const int GENDER_WOMAN = 2;

  static const int FULL_TIME_JOB = 1;
  static const int NOT_FULL_TIME_JOB = 0;

  //0：未知，1：男，2：女
  @JsonKey(defaultValue: 1)
  int gender;

  //身份证号
  String idCard;

  //是否全职，0：否，1：是
  @JsonKey(defaultValue: 1)
  int isFulltimeJob;

  String realname;

  int userId;

  String username;

  @JsonKey(name: 'headImage')
  String headImage;

  @JsonKey(name: 'nickname')
  String nickname;

  @JsonKey(name: 'storeNo')
  String storeNo;

  @JsonKey(name: 'maxDiscount')
  int maxDiscount;

  @JsonKey(name: 'decreaseLimit')
  int decreaseLimit;

  int roleId;

  int superRole;

  String roleName;

  String ctime;

  Staff({
    this.gender,
    this.idCard,
    this.isFulltimeJob,
    this.realname,
    this.userId,
    this.username,
    this.roleId,
    this.ctime,
    this.decreaseLimit,
    this.headImage,
    this.maxDiscount,
    this.nickname,
    this.storeNo,
    this.roleName,
    this.superRole,
  });

  factory Staff.fromJson(Map<String, dynamic> json) => _$StaffFromJson(json);

  Map<String, dynamic> toJson() => _$StaffToJson(this);
}
